package com.mcx.modules.data.localdata.create;

import com.mcx.modules.data.GameDataTableParser;
import com.mcx.modules.data.base.AbstractDBModel;

/** Shop数据管理 */
public class ShopDBModel extends AbstractDBModel<ShopDBModel, ShopEntity>
{
    private static ShopDBModel instance;

    public static ShopDBModel getInstance() {
        if (instance == null) {
            instance = new ShopDBModel();
        }
        return instance;
    }

    /** 文件名称 */
    @Override
    protected String FileName() {
        return "Shop.data";
    }

    /** 创建实体 */
    @Override
    protected ShopEntity MakeEntity(GameDataTableParser parse)
    {
        ShopEntity entity = new ShopEntity();
        entity.Id = parse.GetFieldValueToInt("Id");
        entity.ShopCategoryId = parse.GetFieldValueToInt("ShopCategoryId");
        entity.GoodsType = parse.GetFieldValueToInt("GoodsType");
        entity.GoodsId = parse.GetFieldValueToInt("GoodsId");
        entity.OldPrice = parse.GetFieldValueToInt("OldPrice");
        entity.Price = parse.GetFieldValueToInt("Price");
        entity.SellStatus = parse.GetFieldValueToInt("SellStatus");
        return entity;
    }
}
